
<style>
    @media (min-width: 768px){
        .roleList {
            margin-right: 0;
            margin-left: 0;
            background-color: #fff;
            border-color: #ddd;
            border-width: 1px;
            border-radius: 4px 4px 0 0;
            -webkit-box-shadow: none;
            box-shadow: none;
        }
    }
</style>
<?php
$priceAdjustTable = new BASheet('priceAdjust');
$priceAdjust = $priceAdjustTable->getListById($priceAdjustId);
$finalTable = new BASheet('finalPriceAdjust', $priceAdjust);
$finalView = $finalTable->getView();

$finalList = array();
?>
<p class="text-right"><?php
    echo $control->getAjaxLink(
            array('name' => '价格调整列表', 'id' => 'showPriceAdjustList'), array(
        'bookableId' => $bookableId
    ));
    ?>
    <?php
    if ($priceAdjustId > 0) {
        echo '|';
        echo $control->getAjaxLink(array('name' => '设置价格调整', 'id' => 'showAddPriceAdjust'), array(
            'bookableId' => $bookableId,
            'priceAdjustId' => $priceAdjustId
        ));
    }
    ?>
    <?php
    if ($priceAdjustId > 0) {
        echo '|';
        echo $control->getAjaxLink(array('name' => '会员列表', 'id' => 'showRoleList'), array(
            'bookableId' => $bookableId,
            'priceAdjustId' => $priceAdjustId
        ));
    }
    ?>|最后价格表

</p>
<table class="table table-hover">
    <thead>
        <tr>
            <th>
                <input type="checkbox"  id="selectAll"> 
            </th>
            <th><?php echo '名称'; ?></th>
            <th><?php echo '最后价格'; ?></th>
            <th><?php echo '会员角色'; ?></th>
            <th><?php echo '操作'; ?></th>
        </tr> 
    </thead>
    <fieldset>
        <tbody>
            <?php
            foreach ($finalView as $id => $list) {
                $name = $list->getItem('priceAdjustName')->getValue();
                $price = $list->getItem('finalPrice')->getValue();
                $roleName = $list->getItem('roleName')->getValue();
                ?>
                <tr>
                    <td><label class="checkbox">
                            <input type="checkbox" name="checkbox[]" value="<?php echo $list->getId(); ?>"> 
                        </label></td>
                    <td><?php echo $name; ?></td>
                    <td><?php echo $price; ?></td>
                    <td><?php echo $roleName; ?></td>
                    <td><?php
                        echo $control->getAjaxLink(array('name' => '删除', 'id' => 'deleteFinalPrice'), array(
                            'bookableId' => $bookableId,
                            'priceAdjustId' => $priceAdjustId,
                            'finalAdjustId' => $id
                        ));
                        ?></td>
                </tr>
            <?php } ?>
        </tbody>
    </fieldset>
</table>
<div class="row-fluid">
    <?php
    if (isset($priceAdjustId) && $priceAdjustId > 0) {
        echo $control->getAjaxLink(array('name' => '计算最后价格', 'id' => 'finalizePriceAdjust'), array(
            'bookableId' => $bookableId,
            'priceAdjustId' => $priceAdjustId,
            'htmlOptions' => array('class' => 'btn')));
    }
    ?>
</div>